﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Xiaov.SmartWeb.Infrastructure.ExtMethod;
using Xiaov.SmartWeb.Model;
using Xiaov.SmartWeb.Model.ActiveRecord;
using Xiaov.SmartWeb.Infrastructure.Common;

namespace Xiaov.SmartWeb.Application.PluginSrc.GuestBook
{
    public partial class DeleteSubject :BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            PM_FilterByProperty(ModulePropoty.MODULEURL, "/PluginSrc/GuestBook/SubjectList.aspx");
            string Id = Request.QueryString["id"].ToRequestString();
            A_GUESTBOOK_SUBJECT subject = A_GUESTBOOK_SUBJECT.TryFind(Id);
            if (subject != null)
            {
                A_GUESTBOOK_COMMENT.DeleteAll("SUBJECTID='"+Id+"'");
                subject.Delete();
                subject.Refresh();
                General.ShowAlert("操作提示", "删除成功", "SubjectList.aspx");
            }

        }
    }
}